<?php

class LoginModel extends Model {

	public function update_hash($user_id) {
		$user = M( 'User' );
		$condition ['user_id'] = $user_id;
		
		$user_info = $user->field('user_id, user_pass')->where($condition)->find();
	
		if ($user-> where($condition)->setField('sessioncode',md5($user_info['$user_id'].$user_info['user_pass'].time()))) {
			return true;
		}else {
			return false;
		}
	
	}
}

?>